package my.myorm.tool.jdbc;


import java.util.ArrayList;
import java.util.List;

/**
 * 查询转换后的记录，与ResultSet对应的查询结果
 *
 * @author Skeven Huang
 * @version 1.0
 */
public class ResultList {
    private List data = new ArrayList();
    private int allCount = 0;

    /**
     * 若是分页查询，返回总记录数；否则返回0
     *
     * @return
     */
    public int getAllCount() {
        return allCount;
    }

    protected void setAllCount(int allCount) {
        this.allCount = allCount;
    }

    /**
     * 获取resultlist中记录的个数
     *
     * @return
     */
    public int size() {
        return data.size();
    }

    /**
     * 获取第i个记录
     *
     * @param i
     * @return
     */
    public RecordMap get(int i) {
        return (RecordMap) data.get(i);
    }

    protected void add(RecordMap u) {
        data.add(u);
    }

    protected void addList(List li){
        data.addAll(li);
    }
}
